var express = require('express');
var router = express.Router();
const questionController = require('../controllers/questionController');
const userController = require('../controllers/userController')


// 校验
router.use(userController.verifyToken)

// 新增
router.post('/add', questionController.addQuestion);
// 删除
router.delete('/delete', questionController.deleteQuestion);
// 修改
router.put('/update', questionController.updateQuestion);
// 列表
router.get('/list', questionController.getQuestionList);
// 列表带收藏量
router.get('/list/withCollection', questionController.getQuestionListWithCollectionCount);
// 根据id查询详情
router.get('/:id', questionController.getQuestionById);


module.exports = router;